﻿@model QuanLyGiaoVuUI.Models.GiangVienClient.CapNhatGiangVienClientViewModel
@using QuanLyGiaoVuUI.Helpers;
@{
    ViewBag.Title = "ThemGiangVien";
    Layout = "~/Views/Shared/_GiangVienClientLayout.cshtml";
    //Layout = null;
}
<style>
    div#content-table-inner {
        width:60%;
        margin:0 auto;
    }
    table.display th {
        width:20%;
        text-align:left;
    }
</style>

<!--  start page-heading -->


<div id="gv-main-wrapper">
    @{ Html.RenderPartial("GiangVienClientMenuPartial");}


    <div id="main" class="grid_10 gvclientmain">
        <!--  start page-heading -->

        <div id="page-heading" class="box round first grid">
            <h2>Chào...</h2>
            <!-- end page-heading -->

            <div id="gvclientmaincontent" class="block">
                <div id="content-table-inner">
                    <!-- start id-form -->
                    @*@{Html.EnableClientValidation();}*@
                    @using (Ajax.BeginForm("CapNhat", "GiangVienClient", new AjaxOptions { HttpMethod = "POST", OnSuccess = "ThongBao" }))
                    {                    
                        //@Html.ValidationSummary(true)
                        @Html.HiddenFor(model => model.ID)
        
                        <table class="data display datatable">
                            <tr>
                                <th>@Html.LabelFor(model => model.HoTenGV)</th>
                                <td>@Html.TextBoxFor(model => model.HoTenGV, new { @class = "inp-form" }) @Html.MyValidationMessageFor(model => model.HoTenGV)</td>
                            </tr>
                            <tr>
                                <th valign="top">@Html.LabelFor(model => model.GioiTinh)</th>
                                <td>
                                    <select class="styledselect_form_1" name="GioiTinh">
                                        @if (Model.GioiTinh == 1)
                                        {
                                            <option value="1" selected="selected">Nam</option>
                                            <option value="0">Nữ</option>
                                        }
                                        else
                                        {
                                            <option value="1">Nam</option>
                                            <option value="0" selected="selected">Nữ</option>
                                        }
                                    </select>
                                </td>
                            </tr>
                            <tr>
                                <th valign="top">@Html.LabelFor(model => model.NgaySinh)</th>
                                <td><span>@Html.TextBox("NgaySinh", Model.ID.Equals(Guid.Empty) ? "" : Model.NgaySinh.ToShortDateString(), new { @class = "date_picker" })</span> <span>(mm/dd/yyyy)</span>
                                    <span>@Html.ValidationMessageFor(model => model.NgaySinh)</span></td>
                            </tr>
                            <tr>
                                <th valign="top">@Html.LabelFor(model => model.SoDienThoai)</th>
                                <td>@Html.TextBoxFor(model => model.SoDienThoai, new { @class = "inp-form" }) @Html.MyValidationMessageFor(model => model.SoDienThoai)</td>
                            </tr>
                            <tr>
                                <th valign="top">@Html.LabelFor(model => model.DiaChi)</th>
                                <td>@Html.TextBoxFor(model => model.DiaChi, new { @class = "inp-form" }) @Html.MyValidationMessageFor(model => model.DiaChi)</td>
                            </tr>
                            <tr>
                                <th valign="top">@Html.LabelFor(model => model.Email)</th>
                                <td>@Html.TextBoxFor(model => model.Email, new { @class = "inp-form" }) @Html.MyValidationMessageFor(model => model.Email)</td>                                
                            </tr>
                            <tr>
                                <th>&nbsp;</th>
                                <td valign="top"></td>
                            </tr>
                        </table>
                        <input type="submit" value="Lưu thông tin" id="submit-form" />
        
                    }
                </div>
                <!-- end id-form  -->

                <div class="clear"></div>

                <!--  end content-table-inner  -->

                <div id="themmon-dialog"></div>

            </div>
        </div>
    </div>

    <div class="clear">&nbsp;</div>

</div>


<script>
    $(document).ready(function () {
        $(".date_picker").datepicker();
        $("#tabs").tabs();
        $("#submit-form").button();
    });
    function ThongBao(data) {
        if (data.success)
            ToastManager.showSuccessToast("Cập nhật thành công.");
        else {
            ToastManager.showStickyWarningToast(data.message);
        }
    }
</script>
